//
//  JWKBaseTableViewController.swift
//  Weibo
//
//  Created by 姜维克 on 16/5/20.
//  Copyright © 2016年 姜维克. All rights reserved.
//

import UIKit

class JWKBaseTableViewController: UITableViewController , JWKHomeVisitorViewDelegate{
    
    lazy var visitorView : JWKHomeVisitorView = JWKHomeVisitorView()
    lazy var login : Bool = JWKUserAccountViewModel.sharedUserAccountViewModel.userLogin
        override func loadView() {
            
        
        if login{
            super.loadView()
        }else{
            let v = visitorView
            //设置代理
            v.visitorDelegate = self
            view = v
            
        }
        
    }
    
    ///MARK:实现协议方法用户注册
    func userWillRegister() {
        
        
        print("注册")
    }
    
    ///MARK:实现协议方法用户登录
    func userWillLogin() {
        
        let oauth = JWKOAuthViewController()
        let nav = JWKBaseNavController(rootViewController: oauth)
        presentViewController(nav, animated: true, completion: nil)
//        print("登录")
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source


}
